﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace Core.Models
{


    [MetadataType(typeof(Address_Validation))]
    public partial class Address
    {
    }

    public class Address_Validation
    {
        [HiddenInput(DisplayValue=false)]
        public Guid AddressId { get; set; }

        [StringLength(127, ErrorMessage = "Street Address Line 1 cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Street Address Line 1")]
        public string Line1 { get; set; }

        [StringLength(127, ErrorMessage = "Street Address Line 2 cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Street Address Line 2")]
        public string Line2 { get; set; }

        [Required(ErrorMessage = "City is required.")]
        [StringLength(127, ErrorMessage = "City cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "City")]
        public string City { get; set; }

        [StringLength(25, ErrorMessage = "State cannot be more than 25 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "State")]
        public string State { get; set; }

        [StringLength(10, ErrorMessage = "Zip/Postal Code cannot be more than 10 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Zip/Postal Code")]
        public string PostalCode { get; set; }

        [StringLength(127, ErrorMessage = "Country cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Country")]
        public string Country { get; set; }
    }

    public class ActionLink
    {
        public string LinkText { get; set; }
        public string ActionName { get; set; }
        public string ControllerName { get; set; }
        public string Area { get; set; }
        public Guid Id { get; set; }
    }

    public partial class MainMenu
    {

        [Display(Name = "Hide On Small Device")]
        public bool HideOnSmallDevice 
        { 
            get { return HideOnSmallDeviceYN == "Y"; }
            set { HideOnSmallDeviceYN = value ? "Y" : "N"; }
        }
    }

    [MetadataType(typeof(Theme_Validation))]
    public partial class Theme
    {

        [Display(Name = "For Mobile")]
        public bool IsForMobile
        {
            get { return IsForMobileYN == "Y"; }
            set { IsForMobileYN = value ? "Y" : "N"; }
        }
    }

    public class Theme_Validation
    {
        [StringLength(127, ErrorMessage = "Name cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Name")]
        public string Name { get; set; }

        [StringLength(127, ErrorMessage = "Layout cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Layout")]
        public string Layout { get; set; }

        [Range(0,1920, ErrorMessage = "Specify 0 for Fluid Width or a number for Fixed Width.")]
        [Display(Name = "Width")]
        public int Width { get; set; }

        [StringLength(127, ErrorMessage = "Content Identifier cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Content Identifier")]
        public string ContentIdentifier { get; set; }

        [StringLength(127, ErrorMessage = "System Menu Identifier cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "System Menu Identifier")]
        public string SysMenuIdentifier { get; set; }

        [StringLength(127, ErrorMessage = "Menu Identifier cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Menu Identifier")]
        public string MenuIdentifier { get; set; }
    }

    public partial class BusinessUnit
    {
        [DataType(DataType.Text)]
        [Display(Name = "Select Plugin")]
        public string PluginIds { get; set; }

        [ScaffoldColumn(false)]
        [Display(Name = "")]
        public string PluginDisplay { get; set; }

        [Display(Name = "Publicly Visible")]
        public bool IsPublicAddress { get; set; }
    }

    public class UserUI
    {

        [ScaffoldColumn(false)]
        public Guid UserId { get; set; }

        [ScaffoldColumn(false)]
        public Guid BusinessUnitId { get; set; }

        [Required(ErrorMessage = "First name is required")]
        [StringLength(127, ErrorMessage = "First name cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "First Name")]
        public string FirstName { get; set; }

        [Required(ErrorMessage = "Last name is required")]
        [StringLength(127, ErrorMessage = "Last name cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Last Name")]
        public string LastName { get; set; }

        [Required(ErrorMessage = "Email is required")]
        [StringLength(127, ErrorMessage = "Email cannot be more than 127 characters.")]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "Email Address")]
        public string Email { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "Select Role")]
        public string RoleIds { get; set; }

        [ScaffoldColumn(false)]
        public string RoleDisplay { get; set; }

        [ScaffoldColumn(false)]
        public string IsDroppedYN { get; set; }

        [ScaffoldColumn(false)]
        public DateTime CreateDT { get; set; }

        [ScaffoldColumn(false)]
        public Guid CreatedById { get; set; }

        [ScaffoldColumn(false)]
        public string CreatedByName { get; set; }

        [ScaffoldColumn(false)]
        public DateTime ModifiedDT { get; set; }

        [ScaffoldColumn(false)]
        public Guid ModifiedById { get; set; }

        [ScaffoldColumn(false)]
        public string ModifiedByName { get; set; }
    }

    [MetadataType(typeof(Domain_Validation))]
    public partial class Domain
    {
        public BusinessUnit PrimaryBusinessUnit { get; set; }
    }

    [Bind(Exclude = "DomainID")]
    public class Domain_Validation
    {
        [Required(ErrorMessage = "Domain name is required e.g. www.somedomain.com")]
        [StringLength(127, ErrorMessage = "Domain name cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Domain Name")]
        public string DomainName { get; set; }

        [Required(ErrorMessage = "Site Title is required.")]
        [StringLength(127, ErrorMessage = "Site Title cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Site Title")]
        public string SiteTitle { get; set; }

        [StringLength(127, ErrorMessage = "Google Analytics Tracking ID cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Google Analytics Tracking ID")]
        public string GoogleAnalyticsAccount { get; set; }

        [Required(ErrorMessage = "You have to specify if this Domain has multiple business units.")]
        [StringLength(1, ErrorMessage = "Can be only 1 character")]
        [Display(Name = "Supports multiple BUs?")]
        public string IsMultiBUYN { get; set; }

        [Required(ErrorMessage = "SMTP Server is required.")]
        [Display(Name = "SMTP Server")]
        [StringLength(127, ErrorMessage = "SMTP Server cannot be more than 127 caharacters")]
        [DataType(DataType.Text)]
        public string SMTPServer { get; set; }

        [Required(ErrorMessage = "SMTP Port is required.")]
        [Display(Name = "SMTP Port")]
        [StringLength(5, ErrorMessage = "SMTP Port cannot be more than 5 caharacters")]
        [DataType(DataType.Text)]
        public string SMTPPort { get; set; }

        [Required(ErrorMessage = "You have to sepcify if need to Use SSL with SMTP")]
        [StringLength(1, ErrorMessage = "Can be only 1 character")]
        [Display(Name = "Use SSL with SMTP?")]
        public string SMTPUseSSLYN { get; set; }

        [Required(ErrorMessage = "SMTP From Address is required.")]
        [Display(Name = "SMTP From Address")]
        [StringLength(127, ErrorMessage = "SMTP From Address cannot be more than 127 caharacters")]
        [DataType(DataType.Text)]
        public string SMTPFrom { get; set; }

        [Required(ErrorMessage = "SMTP Account is required.")]
        [Display(Name = "SMTP Account")]
        [StringLength(127, ErrorMessage = "SMTP Account cannot be more than 127 caharacters")]
        [DataType(DataType.Text)]
        public string SMTPAccount { get; set; }

        [Required(ErrorMessage = "SMTP Password is required.")]
        [Display(Name = "SMTP Password")]
        [StringLength(127, ErrorMessage = "SMTP Password cannot be more than 127 caharacters")]
        [DataType(DataType.Password)]
        public string SMTPPassword { get; set; }

        [Required(ErrorMessage = "You have to sepcify if you want to enable self registration on this Domain")]
        [StringLength(1, ErrorMessage = "Can be only 1 character")]
        [Display(Name = "Enable Self Registration?")]
        public string EnableSelfRegisterYN { get; set; }

        [Required(ErrorMessage = "You have to select a Theme to be used with this Domain")]
        [Display(Name = "Theme")]
        public Guid ThemeId { get; set; }

        [Required(ErrorMessage = "You have to select a Mobile Theme to be used with this Domain")]
        [Display(Name = "Mobile Theme")]
        public Guid MobileThemeId { get; set; }

        [Required(ErrorMessage = "You have to sepcify if you want to allow sending emails using these SMTP settings")]
        [StringLength(1, ErrorMessage = "Can be only 1 character")]
        [Display(Name = "Allow Sending Emails?")]
        public string SMTPAllowSendYN { get; set; }

        [Required(ErrorMessage = "You have to specify Subscription Level for this Domain")]
        [StringLength(1, ErrorMessage = "Can be only 1 character")]
        [Display(Name = "Subscription Level")]
        public string SubscriptionLevel { get; set; }

        [ScaffoldColumn(false)]
        public string IsDroppedYN { get; set; }

        [ScaffoldColumn(false)]
        public DateTime CreateDT { get; set; }

        [ScaffoldColumn(false)]
        public Guid CreatedById { get; set; }

        [ScaffoldColumn(false)]
        public string CreatedByName { get; set; }

        [ScaffoldColumn(false)]
        public DateTime ModifiedDT { get; set; }

        [ScaffoldColumn(false)]
        public Guid ModifiedById { get; set; }

        [ScaffoldColumn(false)]
        public string ModifiedByName { get; set; }
    }

    [MetadataType(typeof(BU_Validation))]
    public partial class BusinessUnit
    {
    }

    public class BU_Validation
    {
        [HiddenInput(DisplayValue = false)]
        public Guid BusinessUnitId { get; set; }

        [HiddenInput(DisplayValue = false)]
        public Guid DomainId { get; set; }

        [Required(ErrorMessage = "Business Unit name is required.")]
        [StringLength(127, ErrorMessage = "Business Unit name cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Business Unit Name")]
        public string BusinessUnitName { get; set; }

        [Required(ErrorMessage = "Phone is required")]
        [StringLength(15, ErrorMessage = "Phone cannot be more than 15 characters.")]
        [DataType(DataType.PhoneNumber)]
        [Display(Name = "Phone")]
        public string Phone { get; set; }

        [StringLength(15, ErrorMessage = "Fax cannot be more than 15 characters.")]
        [DataType(DataType.PhoneNumber)]
        [Display(Name = "Fax")]
        public string Fax { get; set; }

        [Required(ErrorMessage = "Email is required")]
        [StringLength(127, ErrorMessage = "Email cannot be more than 127 characters.")]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "Email Address")]
        public string Email { get; set; }

        [ScaffoldColumn(false)]
        public string IsDroppedYN { get; set; }

        [ScaffoldColumn(false)]
        public DateTime CreateDT { get; set; }

        [ScaffoldColumn(false)]
        public Guid CreatedById { get; set; }

        [ScaffoldColumn(false)]
        public string CreatedByName { get; set; }

        [ScaffoldColumn(false)]
        public DateTime ModifiedDT { get; set; }

        [ScaffoldColumn(false)]
        public Guid ModifiedById { get; set; }

        [ScaffoldColumn(false)]
        public string ModifiedByName { get; set; }
    }

    [MetadataType(typeof(TagCategory_Validation))]
    public partial class TagCategory
    {
    }

    [Bind(Exclude = "TagCategoryID")]
    public class TagCategory_Validation
    {
        [Required(ErrorMessage = "Tag Category is required.")]
        [StringLength(127, ErrorMessage = "Tag Category cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Tag Category")]
        public string TagCategoryName { get; set; }

        [ScaffoldColumn(false)]
        public Guid BusinessUnitId { get; set; }

        [ScaffoldColumn(false)]
        public string IsDroppedYN { get; set; }

        [ScaffoldColumn(false)]
        public DateTime CreateDT { get; set; }

        [ScaffoldColumn(false)]
        public Guid CreatedById { get; set; }

        [ScaffoldColumn(false)]
        public string CreatedByName { get; set; }

        [ScaffoldColumn(false)]
        public DateTime ModifiedDT { get; set; }

        [ScaffoldColumn(false)]
        public Guid ModifiedById { get; set; }

        [ScaffoldColumn(false)]
        public string ModifiedByName { get; set; }
    }
    
    [MetadataType(typeof(Tag_Validation))]
    public partial class Tag
    {
    }

    [Bind(Exclude = "TagID")]
    public class Tag_Validation
    {
        [Required(ErrorMessage = "Tag is required.")]
        [StringLength(127, ErrorMessage = "Tag cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Tag")]
        public string TagName { get; set; }

        [ScaffoldColumn(false)]
        public Guid BusinessUnitId { get; set; }

        [ScaffoldColumn(false)]
        public Guid TagCategoryId { get; set; }

        [ScaffoldColumn(false)]
        public string IsDroppedYN { get; set; }

        [ScaffoldColumn(false)]
        public DateTime CreateDT { get; set; }

        [ScaffoldColumn(false)]
        public Guid CreatedById { get; set; }

        [ScaffoldColumn(false)]
        public string CreatedByName { get; set; }

        [ScaffoldColumn(false)]
        public DateTime ModifiedDT { get; set; }

        [ScaffoldColumn(false)]
        public Guid ModifiedById { get; set; }

        [ScaffoldColumn(false)]
        public string ModifiedByName { get; set; }
    }
}
